The present invention relates to methods of processing digital color images, and more particularly to a method of adjusting the color of a digital color image.
In photographic printing of film, such as a color photographic negative, it is a well known practice to xe2x80x98correctxe2x80x99 the color balance by causing the overall color balance of the print to be a shade near gray. This correction strategy is based on the assumption that the overall average of the scene integrates to a gray color and is very effective at reducing the effects resulting from different scene illuminants that are spectrally different such as tungsten and daylight. In a like manner, image sensing apparatus such as a video camera, average, over a time period, color difference signals, R-Y and B-Y, to a zero value. This is equivalent to integrating to gray.
These methods work well for the majority of scene and illuminant combinations. However, when the scene subject matter is highly colored, particularly with a single dominant color, the integrate to gray strategy fails as this dominant scene color is mistaken for an illuminant bias. This failure, known as subject failure, produces unpleasant color casts in the color complimentary to the dominant scene color. There are various strategies for minimizing these failures. These strategies are typically based on reducing the amount of correction based on a population of images and/or on the information in neighboring frames. Other color problems result from fading of the dyes in a photographic image, printing and processing errors, film keeping problems, and in the case of a color digital image that is captured directly with an electronic camera, a misadjusted black point in the camera.
With a digital image obtained either directly from an electronic camera or indirectly by scanning a photographic print or film, it is possible to manually adjust the color balance by using any of the well known digital photographic manipulation tools such as Adobe Photoshop(copyright). However, manual adjustment is not practical for automated printing of digital images. A digital image provides much information that can be used for calculating color adjustments, and several methods have been proposed for performing these adjustments automatically. Some of these methods, such as that taught in U.S. Pat. No. 5,555,022 issued Sep. 10, 1996 to Haruki et al., divide the scene information into a plurality of regions representing different locations within a scene. Means to select and weight the correction of these blocks are then employed to provide automatic white balancing and to restrict the degree to which color correction gain is applied. U.S. Pat. No. 4,984,071 issued Jan. 8, 1991 to Yonezawa teaches a method for adjusting a gradation curve based on identifying shadow and highlight points by utilizing histogram data. U.S. Pat. No. 5,062,058 issued Oct. 29, 1991 to Morikawa describes a system that uses a cumulative histogram to designate highlight and shadow points. Other histogram based methods are taught by: U.S. Pat. No. 5,812,286 issued Sep. 22, 1998 to Lin, and U.S. Pat. No. 5,265,200 issued Nov. 23, 1993 to Edgar. Edgar further describes a method performing a second order best fit regression of the histogram data and includes methods to eliminate some histogram values from consideration in the regression.
Another approach that combines color correction with tone scale corrections is based on random sampling within a digitized image and subsequently modifying the resulting histogram of these samples. U.S. Pat. No. 4,677,465 issued Jun. 30, 1987 to Alkofer, and U.S. Pat. No. 4,729,016 issued Mar. 1, 1988 to Alkofer, disclose relatively complex methods that utilize these samples in a plurality of segmented contrast intervals through normalization techniques and with comparison to image population data.
An approach that is specifically designed to correct for dye-fade in Ektacolor paper involves generating a 3xc3x973 restoration matrix. The matrix is a matrix of coefficients of second order polynomials in time, with constants that are optimized for specific paper, and are applied in logarithmic space, which compensate for the image-wise light filtration from overlying layers in the film. The compensation matrix is followed by tone-scale adjustments; see U.S. Pat. No. 5,796,874 issued Aug. 18, 1998 to Woolfe et al. To date, none of these prior art techniques have proven entirely satisfactory in addressing the problem of automatically adjusting color in a digital image, particularly where the digital image has been derived by scanning an image that has experienced severe dye fade.
In addition, many of the above cited histogram methods only utilize a fraction of the image data near the ends of the histogram data. Furthermore, individual color channel histograms do not maintain any linkage of channel information at the pixel level. In other words, unless the image is monochrome, the pixels for a particular level in the histogram for one channel correspond to many levels in the other channels. This lack of linkage can cause errors with the above described histogram methods, particularly when there are highly saturated colors and when there is clipping of the image data.
There is a need therefore for an improved digital image processing method for automatically adjusting the color balance of a digital image.
The need is met according to the present invention by providing a method of processing a digital color image having pixels and a plurality of color channels that includes the steps of: generating a reference image from the digital color image; regressing the color channels of the digital color image to the reference image to obtain a plurality of regression factors for each color channel; and, applying the regression factors on a pixel by pixel basis to the respective channels of the digital color image to produce a processed digital color image.
The present invention has the advantages that it utilizes all of the image pixels in a manner that retains image data linkage at the pixel level, provides both gain and offset terms required to correct severe color biases such as those resulting from long term keeping of color dye images, and can be easily combined with masking techniques to further improve performance.